package com.zzc.emotisenseclassroom.controller.emotisenseScore;

import com.zzc.common.response.ZzcResponse;
import com.zzc.emotisenseclassroom.common.ResponseCodeEnum;
import com.zzc.emotisenseclassroom.domain.sudentScore.dto.StudentBarAndPieOptionRequestDTO;
import com.zzc.emotisenseclassroom.domain.sudentScore.dto.StudentLineOptionRequestDTO;
import com.zzc.emotisenseclassroom.domain.sudentScore.service.StudentScoreService;
import com.zzc.emotisenseclassroom.domain.user.dto.GetStudentIdAndNameReqDTO;
import com.zzc.emotisenseclassroom.domain.user.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Copyright Zzc
 * FileName: StudentScoreController
 * Author:   Zzc
 * Date:     2024/5/412:24
 * Description:学生课堂专注度评分控制器
 * hISTORY:
 * <author>  <time>     <version>    <desc>
 * 作者姓名   修改时间       版本号       描述
 * Zzc                   1.0.0
 */
@RestController
@RequestMapping("/studentScore")
public class StudentScoreController {
    @Autowired
    private StudentScoreService studentScoreService;
    @Autowired
    private StudentService studentService;

    @PostMapping("/line")
    public ZzcResponse getStudentLineOption(@RequestBody StudentLineOptionRequestDTO requestDTO){
        return ZzcResponse.success(ResponseCodeEnum.GET_LINE_OPTION_SUCCESS,
                studentScoreService.getStudentLineOption(requestDTO));
    }

    @PostMapping("/barAndPie")
    public ZzcResponse getStudentBarAndPieOption(@RequestBody StudentBarAndPieOptionRequestDTO requestDTO){
        return ZzcResponse.success(ResponseCodeEnum.GET_BAR_AND_PIE_OPTION_SUCCESS,
                studentScoreService.getStudentBarAndPieOption(requestDTO));
    }

    @PostMapping("/getStudentIdAndNameList")
    public ZzcResponse getStudentIdAndNameList(@RequestBody GetStudentIdAndNameReqDTO reqDTO){
        return ZzcResponse.success(ResponseCodeEnum.SEARCH_SUCCESS, studentService.getStudentIdAndNameList(reqDTO));
    }
}
